package com.meida.module.pay.provider.controller;

import com.meida.common.mybatis.model.*;
import com.meida.common.springmvc.base.BaseController;
import com.meida.module.pay.client.entity.Invoice;
import com.meida.module.pay.provider.service.PayInvoiceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;


/**
 * 发票控制器
 *
 * @author flyme
 * @date 2019-06-26
 */
@RestController
@RequestMapping("/invoice/")
@Api(tags = "发票管理")
public class PayInvoiceController extends BaseController<PayInvoiceService, Invoice> {

    @ApiOperation(value = "发票-列表", notes = "发票列表 ")
    @GetMapping(value = "page")
    public ResultBody pageList(@ModelAttribute(value = "pageModel") PageModel pageModel) {
        return bizService.pageList(pageModel);
    }


    @ApiOperation(value = "发票-添加", notes = "添加发票")
    @PostMapping(value = "add")
    public ResultBody add(SaveModel model) {
        return bizService.add(model);
    }


    @ApiOperation(value = "发票-更新", notes = "更新发票")
    @PostMapping(value = "update")
    public ResultBody update(UpdateModel model) {
        return bizService.edit(model);
    }

    @ApiOperation(value = "发票-删除", notes = "删除发票")
    @PostMapping(value = "remove")
    public ResultBody remove(DeleteModel model) {
        return bizService.delete(model);
    }

}
